function [logjoint, logprior] = prop(X, Z, V, alphav, sigmax, sigmaz, sigmav)
% -log(prior)
mlogprior = (0.5/sigmav^2)*norm(V, 'fro')^2 + numel(V)*log(sigmav) + ...
    (0.5/sigmaz^2)*norm(Z, 'fro')^2 + nnz(Z)*log(sigmaz) - ...
    logpibp(Z, alphav) + 0.5*(numel(V)+nnz(Z))*log(2*pi);

% -log(likelihood)
mloglhd = 0.5/sigmax^2*norm(X-Z*V', 'fro')^2 + ...
    0.5*numel(X)*log(2*pi) + numel(X)*log(sigmax);

logprior = -mlogprior;
logjoint = logprior - mloglhd;

end

